package live.zs.config;

import io.quarkus.runtime.annotations.StaticInitSafe;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithName;
import io.smallrye.config.WithParentName;

/**
 * @author madison
 * @description
 * @date 2022/2/2 12:45
 */
@StaticInitSafe
@ConfigMapping(prefix = "server", namingStrategy = ConfigMapping.NamingStrategy.KEBAB_CASE)
public interface Server {
    @WithName("name")
    String host();

    int port();

    @WithParentName
    ServerHostAndPort hostAndPort();

    @WithParentName
    ServerInfo info();

    // NamingStrategy
    String theHost();

    int thePort();

    // A nested mapping provides a way to subgroup other config properties:

    Log log();

    interface Log {
        boolean enabled();

        String suffix();

        boolean rotate();
    }
}
